Title Case a Sentence-Javascript

69

Title Case a Sentence-Javascript -

function titleCase(str) {
  return str.toLowerCase().replace(/(^|\s)\S/g, L => L.toUpperCase());
}

Comments

Submit
0 Comments